<?php

/**
 * AbetQuestionnaire filter form base class.
 *
 * @package    sfproject
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAbetQuestionnaireFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'course_Code'     => new sfWidgetFormPropelChoice(array('model' => 'AbetPlanStudy', 'add_empty' => true, 'key_method' => 'getCode')),
      'instructor_Code' => new sfWidgetFormPropelChoice(array('model' => 'AbetInstructor', 'add_empty' => true, 'key_method' => 'getCode')),
      'department_Code' => new sfWidgetFormPropelChoice(array('model' => 'AbetDepartment', 'add_empty' => true, 'key_method' => 'getCode')),
      'question_Text'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'question_Type'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'question_Kind'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'course_Code'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetPlanStudy', 'column' => 'code')),
      'instructor_Code' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetInstructor', 'column' => 'code')),
      'department_Code' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'AbetDepartment', 'column' => 'code')),
      'question_Text'   => new sfValidatorPass(array('required' => false)),
      'question_Type'   => new sfValidatorPass(array('required' => false)),
      'question_Kind'   => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('abet_questionnaire_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AbetQuestionnaire';
  }

  public function getFields()
  {
    return array(
      'id'              => 'Number',
      'course_Code'     => 'ForeignKey',
      'instructor_Code' => 'ForeignKey',
      'department_Code' => 'ForeignKey',
      'question_Text'   => 'Text',
      'question_Type'   => 'Text',
      'question_Kind'   => 'Text',
    );
  }
}
